<!-- 为您推荐 -->
<template>
    <s-card>
        <template v-slot:title>通知公告</template>
        <template v-slot:content>
            <div class="notice-cont">
                <div class="left">
                    <div>
                        <img src="../../../assets/images/home/notice_1.png" />
                        <p>系统公告</p>
                    </div>
                </div>
                <ul class="right">
                    <li v-for="item in noticeList" :key="item.id">
                        <img src="../../../assets/images/home/notice_2.png" />
                        <div class="title">
                            <p>{{ item.title }}</p>
                            <span>
                                {{ item.updatedTime }}
                            </span>
                        </div>
                    </li>
                </ul>
            </div>
        </template>
    </s-card>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { NoticeVO } from '@/api/notice/types.ts'
import SCard from '@/components/SCard/index.vue'

const noticeList = ref<NoticeVO[]>([
    {
        id: '1',
        title: '通知公告通知公告通知公告通知公告',
        updatedTime: '2024-10-29',
    },
    {
        id: '2',
        title: '通知公告通知公告通知公告通知公告',
        updatedTime: '2024-10-29',
    },
    {
        id: '3',
        title: '通知公告通知公告通知公告通知公告',
        updatedTime: '2024-10-29',
    },
    {
        id: '3',
        title: '通知公告通知公告通知公告通知公告',
        updatedTime: '2024-10-29',
    },
])
</script>
<style scoped lang="scss">
.notice-cont {
    display: flex;
    .left {
        min-width: 60px;
        height: 197px;
        background-color: var(--background-color-primary-hover);
        border-radius: 8px;
        margin-right: 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        img {
            width: 15px;
            height: 19px;
        }
        p {
            font-size: 12px;
            margin-top: 4px;
        }
    }
    .right {
        flex: 1;
        li {
            height: 40px;
            padding: 0 14px 0 10px;
            border-radius: 8px;
            border: 1px solid var(--border-color-light);
            display: flex;
            align-items: center;
            margin-bottom: 6px;
            cursor: pointer;
            img {
                width: 20px;
                height: 20px;
                margin-right: 8px;
            }
            .title {
                flex: 1;
                display: flex;
                justify-content: space-between;
                align-items: center;
                font-size: 12px;
                color: var(--text-color-secondary);
                p {
                    max-width: 120px;
                    white-space: nowrap; /* 不换行 */
                    overflow: hidden; /* 隐藏超出部分 */
                    text-overflow: ellipsis; /* 显示省略号 */
                }
                span {
                    color: var(--text-color--gray);
                }
            }
            .title:hover {
                color: var(--color-primary);
            }
        }
    }
}
</style>
